#include <stdio.h>

copystr(char *p1, char *p2, int m)
{	    		 
    int n;

    n = 0;
    while (n < m - 1)
    {	    		 
        n++;
        p1++;
    }
    while (*p1 != '\0')
    {	    		 
        *p2 = *p1;
        p1++;
        p2++;
    }
    *p2 = '\0';
}	    		 

int main(void)
{	    		 
    int m;
    char str1[20], str2[20];

    printf("请输入一个字符串：\n");
    scanf("%s", str1);
    printf("从第几个字符开始复制？");
    scanf("%d", &m);
    if (strlen(str1) < m)
    {	    		 
        printf("输入错误。");
    }
    else
    {	    		 
        copystr(str1, str2, m);
        printf("复制结果为：%s", str2);
    }

    return 0;
}	    		 
